//
//  ViewController.m
//  demo
//
//  Created by liulei on 2019/1/18.
//  Copyright © 2019年 www.icbc.com.cn. All rights reserved.
//

#import "ViewController.h"
#import "twoViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor whiteColor]];
    UIButton *text =[[UIButton alloc]initWithFrame:CGRectMake(60,60, 120, 30)];
    [text setBackgroundColor:[UIColor blueColor]];
    [text setTitle:@"JUMP" forState:UIControlStateNormal];
    [text setTintColor:[UIColor whiteColor]];
    [text addTarget:self action:@selector(jump2) forControlEvents:UIControlEventTouchUpInside];
    [self.view  addSubview:text];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

-(void)jump2{
    twoViewController *controller =[[twoViewController alloc]init];
    
//    __weak typeof(self) weakSelf = self;
//    controller.block = ^(NSDictionary *dic, NSArray *arr, NSString *str) {
//        [weakSelf nslogSomething];
//    };
    __weak typeof(self) weakSelf = self;
    controller.dblock=^(NSString *str){
        [weakSelf nslogSomething:str];
    };
    [self presentViewController:controller animated:YES completion:nil];
}
-(void)nslogSomething:(NSString *)str
{
    NSLog(@"huidiao:%@",str);
}
@end
